package jpa.entitys.promis.construction;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the COST_BOQ database table.
 * 
 */
@Embeddable
public class CostBoqPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private String company;

	private String project;

	@Column(name="BOQ_CODE")
	private String boqCode;

	private long revision;

	public CostBoqPK() {
	}
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getProject() {
		return this.project;
	}
	public void setProject(String project) {
		this.project = project;
	}
	public String getBoqCode() {
		return this.boqCode;
	}
	public void setBoqCode(String boqCode) {
		this.boqCode = boqCode;
	}
	public long getRevision() {
		return this.revision;
	}
	public void setRevision(long revision) {
		this.revision = revision;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CostBoqPK)) {
			return false;
		}
		CostBoqPK castOther = (CostBoqPK)other;
		return 
			this.company.equals(castOther.company)
			&& this.project.equals(castOther.project)
			&& this.boqCode.equals(castOther.boqCode)
			&& (this.revision == castOther.revision);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.project.hashCode();
		hash = hash * prime + this.boqCode.hashCode();
		hash = hash * prime + ((int) (this.revision ^ (this.revision >>> 32)));
		
		return hash;
	}
}